SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwtProveedores
AS
SELECT     dbo.tb_Proveedores.idProveedor AS ID, dbo.tb_Proveedores.RazonSocial, dbo.tb_Proveedores.Domicilio, 
                      dbo.vwrLocalidades.Descripcion AS Localidad, dbo.tb_Proveedores.Telefono, dbo.tb_Proveedores.Interno, dbo.tb_Proveedores.Fax, 
                      dbo.tb_Proveedores.Movil, dbo.tb_Proveedores.[E-Mail] AS EMail, dbo.tb_Proveedores.Web, dbo.tb_Proveedores.Contacto, 
                      dbo.tb_Proveedores.TelefonoContacto, dbo.tb_Proveedores.MovilContacto, dbo.tb_Proveedores.[E-MailContacto] AS EMailContacto, 
                      dbo.tb_Proveedores.CUIT, dbo.tb_Proveedores.IngresosBrutos, dbo.vwrCondicionesFiscales.Descripcion AS CondicionFiscal
FROM         dbo.tb_Proveedores INNER JOIN
                      dbo.vwrCondicionesFiscales ON dbo.tb_Proveedores.CondicionFiscal = dbo.vwrCondicionesFiscales.ID RIGHT OUTER JOIN
                      dbo.vwrLocalidades ON dbo.tb_Proveedores.Localidad = dbo.vwrLocalidades.ID
GO
GRANT SELECT ON  [dbo].[vwtProveedores] TO [AdministracionEscolar]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionComprasySuministros]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionContable]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionDeposito]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionInventario]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionServiciosEscolares]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [GestionSubsidiosyRendiciones]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [Informatica]
GRANT SELECT ON  [dbo].[vwtProveedores] TO [SoloVer]
GO
